package apresentacao.caminhoneiro;

import dao.caminhoneiro.AsyncTask_Meus_Fretes;
import tcc.caminhoneiro.R;
import adapter.caminhoneiro.FretesAdapter;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

public class Fragment_Meus_Fretes extends Fragment{
	
	ListView lvMeusFretes;
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		View view = inflater.inflate(R.layout.activity_result, null);
		//Toast.makeText(getActivity(), String.valueOf(Activity_Menu_Principal.user_id), Toast.LENGTH_SHORT).show();
		inicializar(view);
		return view;
	}

	private void inicializar(View view) {
		FretesAdapter adapter  = new FretesAdapter(getActivity(), AsyncTask_Meus_Fretes.fretes);
		TextView title = (TextView) view.findViewById(R.id.notifications_title);
		title.setText("Meus Fretes");
		lvMeusFretes = (ListView) view.findViewById(R.id.notifications_list);
		lvMeusFretes.setAdapter(adapter);
	}
}
